<template>
	<view class="device page bgf6">
	

		<scroll-view scroll-y="true" class="list bgf6" @scrolltolower="nextPage">
			<view v-for="(item,index) in list" class="bgff px14 py20 mx12 my16">
				<view class="flex flexC flexB mb12">
					<view class="">
						<text>设备编号：{{item.sn}}</text>
						<text class="bgf6 r40 px10 py2 fs10 ml14" >{{item.type}}</text>
						
					</view>
					
					
				</view>
				<view class="mb12">设备主板号：{{item.device_sn}}</view>
				<view class="flex flexC flexJC mt18 aliC">
					<text class="bg41 r40 w72 py4 mx6" @click.stop="open(item)">开门</text>
					<text class="bg41 r40 w72 py4 mx6" @click.stop="bookList(item)">关门</text>
				
				</view>
			</view>
		</scroll-view>


	</view>
</template>

<script>
	export default {
		data() {
			return {
				statusIndex: 0,
				bindList: ['全部', '已绑', "未绑"],
				statusList: ['全部', '在线', "离线"],
				bindIndex: 0,
				selectShop: null,
				shopList: [],
				keyword: '',
				list: [],
				page: 1,
				isLastPage: false,
				isnodata: false,
				status:'',
				bindStatus:''

			}
		},
		onLoad(option) {

			this.getList();
		},
		methods: {
			
			

			getList() {
				let param = {
					shop_id:uni.getStorageSync("shop_id")
				};
				let that = this;
				this.$api.device(param).then(res => {

					console.info(JSON.stringify(res));
					if (res.code == 1) {
						that.list = res.data;
					} else {

					}
				})
			},

		}
	}
</script>

<style lang="scss" scoped>
	.device {
		.w12 {
			width: 24rpx;
			height: 24rpx;
		}

		.w150 {
			width: calc(50% - 52rpx);
		}

		.list {
			height: calc(100vh - 72rpx);
		}
		.w72{
			width: 120rpx;
			
		}
	}
</style>
